#ifndef GLUTCALLBACKS_H
#define GLUTCALLBACKS_H

#include "GlutCallbackListener.h"

/**
 * Utility class to allow for glut call-backs to be
 * object methods.
 */
class GlutCallbacks {

public:
	GlutCallbacks();

	void registerDisplayListener(GlutCallbackListener* listener);
	void registerIdleListener(GlutCallbackListener* listener);
	void registerKeyboardListener(GlutCallbackListener* listener);
	void registerMotionListener(GlutCallbackListener* listener);
	void registerMouseListener(GlutCallbackListener* listener);
	void registerReshapeListener(GlutCallbackListener* listener);
	void registerSpecialListener(GlutCallbackListener* listener);

	static GlutCallbacks* getInstance();

	static void callbackDisplay();
	static void callbackIdle();
	static void callbackKeyboard(unsigned char key, int x, int y);
	static void callbackMotion(int x, int y);
	static void callbackMouse(int button, int state, int x, int y);
	static void callbackReshape(int width, int height);
	static void callbackSpecial(int key, int x, int y);

private:

	static GlutCallbacks* _instance;

	GlutCallbackListener* _displayListener;
	GlutCallbackListener* _idleListener;
	GlutCallbackListener* _keyboardListener;
	GlutCallbackListener* _motionListener;
	GlutCallbackListener* _mouseListener;
	GlutCallbackListener* _reshapeListener;
	GlutCallbackListener* _specialListener;
	//FIX add support for other callbacks
};

#endif	// GLUTCALLBACKS_H

